<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
    <meta charset="UTF-8">
    <title>index</title>
</head>
<body>
INDEX
<div sec:authorize="isAuthenticated()">
    isAuthenticated
    用户名: <span sec:authentication="name"></span>
    角  色: <span sec:authentication="principal.getAuthorities()"></span>
</div>
<div sec:authorize="!isAuthenticated()">
    isNotAuthenticated
</div>
</body>
</html>